<!--日选择 年月日 和时分秒-->
<template>
    <el-date-picker
        v-model="inputvalue"
        :type="list.type=='date'?'date':'datetime'"
        :placeholder="$t('m.Pleaseenter')+list['title_'+lang]"
        :format="list.config.format"
        :value-format="list.config.valueFormat"
        popper-class="pickerData"
    >
    </el-date-picker>
</template>

<script>
    export default {
        props: ["list","lang","value",'isnone'],
        data() {
            return{
                inputvalue:"",
            }
        },
        mounted(){
            this.rulesList();
        },
        methods:{
            rulesList(){
               var arr = [];
                if(this.list.is_require==1){
                    arr.push({ required: true,message: this.$t('m.Pleaseenter')+this.list['title_'+this.lang]})
                }
                this.$emit('changeRules',this.list.name,arr,this.isnone)
            },
        },
        watch:{
            inputvalue(val,old){
                this.$emit('input',val)
            },
            value:{
                handler(val,old){
                    if(val != "" || val != undefined){
                        this.inputvalue = val;
                    }
                },
                immediate:true,
                deep:true,
            }
        }
    }
</script>
<style lang="less">
    .pickerData .el-button+.el-button{
        margin-left: 0;
    }
</style>